package cn.stylefeng.guns.sys.modular.system.service;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.base.pojo.page.LayuiPageInfos;
import cn.stylefeng.guns.sys.modular.system.entity.BtyContract;
import cn.stylefeng.guns.sys.modular.system.model.params.BtyContractParam;
import cn.stylefeng.guns.sys.modular.system.model.params.BtyElmsxfParam;
import cn.stylefeng.guns.sys.modular.system.model.result.BtyContractResult;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 合同管理 服务类
 * </p>
 *
 * @author liuy
 * @since 2022-05-10
 */
public interface BtyContractService extends IService<BtyContract> {

    /**
     * 新增
     *
     * @author liuy
     * @Date 2022-05-10
     */
    Integer add(BtyContractParam param);

    /**
     * 删除
     *
     * @author liuy
     * @Date 2022-05-10
     */
    void delete(BtyContractParam param);

    /**
     * 更新
     *
     * @author liuy
     * @Date 2022-05-10
     */
    void update(BtyContractParam param);

    /**
     * 查询单条数据，Specification模式
     *
     * @author liuy
     * @Date 2022-05-10
     */
    BtyContractResult findBySpec(BtyContractParam param);

    /**
     * 查询列表，Specification模式
     *
     * @author liuy
     * @Date 2022-05-10
     */
    List<BtyContractResult> findListBySpec(BtyContractParam param) throws ParseException;

    /**
     * 查询分页数据，Specification模式
     *
     * @author liuy
     * @Date 2022-05-10
     */
     LayuiPageInfo findPageBySpec(BtyContractParam param) throws ParseException;

    /**
     * 获取开发人员列表
     * @return
     */
    List<Map>kfryList();

    /**
     * 获取一级区域列表
     * @return
     */
    List<Map>primaryAreaList();

    /**
     * 根据pid获取二级区域
     * @param pid
     * @return
     */
    List<Map>secondaryAreaList(int pid);

    /**
     * 获取店名列表
     * @return
     */
    List<Map>dmList();

    boolean insertContract(List<BtyContract> list);

    List<BtyContractResult>kfry(String dm);

    Boolean batchImport(String fileName, MultipartFile file, BtyContractParam btyElmsxfParam) throws IOException, Exception;

    ResponseEntity<byte[]> exportMx(HttpServletRequest request, HttpServletResponse response, BtyContractParam param);
}
